﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class RoleSelection : MonoBehaviour
{
    public GameObject[] role = new GameObject[3];
    GameObject data;
    int firstHand;//判断先后手
    Slider slider;
    // Start is called before the first frame update
    void Start()
    {
        data = GameObject.FindGameObjectWithTag("Data");
        MsgSyncTank msg = new MsgSyncTank();
        firstHand = Random.Range(1, 1000);
        print(firstHand);
        data.GetComponent<GameData>().firstHand = firstHand;
        //先后手
        msg.x = firstHand;
        NetManager.Send(msg);

    }

    public void Selection(int j)
    {
        for (int i=0;i<role .Length;i++)
        {
            if (i!=j)
            {
                role[i].SetActive(false);

            }
            else
            {
                role[i].SetActive(true);
                
            }
        }
        data.GetComponent<GameData>().rolePoint = j;
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
